package pwsaver;

import com.google.appengine.api.datastore.*;
import com.google.appengine.api.users.User;

import java.util.Date;

public class UserInfo {
	private User user; 
	private Date createDate;

	public static UserInfo CreateUserInfo(User user){
		return new UserInfo(user, new Date());
	}

	public UserInfo(User user, Date date) {
		this.user = user;
		this.createDate =date;
	}

	public User getUser() {
		return this.user;
	}

	public Date getCreateDate() {
		return this.createDate;
	}

	public static Key generateUserKey(User user) {
		return KeyFactory.createKey(UserInfo.class.getSimpleName(), user.getUserId());
	}
	
	public Key getUserKey(){
		return UserInfo.generateUserKey(this.user);
	}

	public void setUser(User user) {
		this.user = user;
	}


}
